package datastructure.maxheap;

import java.util.Random;

/**
 * @author XY
 * @version 1.0
 * @date 2021/12/1 15:53
 * @Description
 */
public class Main {

    public static void main(String[] args) {
        int n = 1000000;
        MaxHeap<Integer> maxHeap = new MaxHeap<>();
        Random random = new Random();
        for (int i = 0; i < n; i++) {
            maxHeap.add(random.nextInt(Integer.MAX_VALUE));
        }
        int[] arr= new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = maxHeap.extractMax();
        }

        for (int i = 1; i < n; i++) {
            if(arr[i-1]<arr[i]){
                throw new RuntimeException("Error");
            }

        }
        System.out.println("good");
    }
}
